CCFLAGS= -Wall -ansi -pedantic -g \
-Waggregate-return \
-Wbad-function-cast \
-Wcast-qual \
-Wcast-align \
-Wdeclaration-after-statement \
-Wendif-labels \
#-Werror \
-Wextra \
-Wfloat-equal \
-Wimport \
-Winline \
-Winvalid-pch \
-Wlong-long \
-Wmissing-declarations \
-Wmissing-field-initializers \
-Wmissing-format-attribute \
-Wmissing-noreturn \
-Wmissing-prototypes \
-Wnested-externs \
-Wold-style-definition \
-Wpacked \
-Wpadded \
-Wpointer-arith \
-Wpointer-sign \
-Wredundant-decls \
-Wshadow \
-Wsign-compare \
-Wstrict-prototypes \
-Wundef \
-Wunreachable-code \
-Wunused-macros \
-Wvariadic-macros \
-Wwrite-strings 

EXECS = kruskal

all: $(EXECS)

kruskal: arista.o tcpalpha.o tcpprior.o heap.o colap.o uf.o tcpalpha.o cra.o stack.o tsalpha.o cintwar.o kruskal.o
	gcc $(CCFLAGS) -o $@ $^

arista.o: arista.c arista.h nodo.h
	gcc $(CCFLAGS) -c $<
tcpalpha.o: tcpalpha.c tcpalpha.h arista.h nodo.h
	gcc $(CCFLAGS) -c $<
heap.o: heap.c heap.h tcpalpha.h arista.h nodo.h tcppos.h bool.h
	gcc $(CCFLAGS) -c $<
colap.o: colap.c colap.h heap.h tcpalpha.h arista.h nodo.h tcppos.h bool.h tcpprior.h
	gcc $(CCFLAGS) -c $<
tcpprior.o: tcpprior.c tcpprior.h bool.h tcpalpha.h arista.h nodo.h
	gcc $(CCFLAGS) -c $<
uf.o: uf.c uf.h tufpos.h bool.h tufalpha.h tufset.h
	gcc $(CCFLAGS) -c $<
tsalpha.o: tsalpha.c tsalpha.h arista.h nodo.h
	gcc $(CCFLAGS) -c $<
stack.o: stack.c stack.h tsalpha.h arista.h nodo.h bool.h tspos.h
	gcc $(CCFLAGS) -c $<
cra.o: cra.c cra.h arista.h nodo.h bool.h
	gcc $(CCFLAGS) -c $<
cintwar.o: cintwar.c cintwar.h arista.h nodo.h bool.h
	gcc $(CCFLAGS) -c $<
kruskal.o: kruskal.c arista.h nodo.h colap.h bool.h tcpalpha.h tcppos.h uf.h tufpos.h \
			tufalpha.h tufset.h cra.h cintwar.h stack.h tsalpha.h
	gcc $(CCFLAGS) -c $<

clean:
	-rm -f *~ *.o $(EXECS)